/**
 * 
 */
package com.rollingstone.customer.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/**
 * @author anshuman
 *
 */

@XmlRootElement(name = "orderdtl")
@Entity
@Table(name="orderdtl")
public class OrderDtl {
	
	@Id
//	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_PRODUCT")
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ORDERID")	
	private Long orderId;
	
	@OneToOne(fetch=FetchType.EAGER)
	@Cascade(value = { CascadeType.ALL })
	@JoinColumn(name="PRODUCTID", nullable=false, insertable=true, updatable=true)
	private Product product;

	@OneToOne(fetch=FetchType.EAGER)
	@Cascade(value = { CascadeType.ALL })
	@JoinColumn(name="CUSTOMERID", nullable=false, insertable=true, updatable=true)	
	private Customer customer;
	
	@Column(name="ORDER_DATE")
	private Date orderDate;
	
	@Column(name="PRODUCT_PRICE")
	private Float productPrice;
	
	@Column(name="ORDER_QTY")
	private Float orderQty;
	
	@Column(name="ORDER_STATUS")
	private String orderStatus;
	

}
